From: Bhupinder Thakur Date: Wed, 27 Sep 2017 06:13:10 +0000 (+0530) Subject: xen/arm: vpl011: Define common ring buffer helper functions in console.h X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1265 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:///%22http:/www.example.com/cgi/%22https:/?a=commitdiff_plain;h=af8d9356417cb617b635c5ace782388ebfe86e3a;p=xen.git xen/arm: vpl011: Define common ring buffer helper functions in console.h DEFINE_XEN_FLEX_RING(xencons) defines common helper functions such as xencons_queued() to tell the current size of the ring buffer, xencons_mask() to mask off the index, which are useful helper functions. pl011 emulation code will use these helper functions. io/console.h includes io/ring.h which defines DEFINE_XEN_FLEX_RING. In console/daemon/io.c, string.h had to be included before io/console.h because ring.h uses string functions. Signed-off-by: Bhupinder Thakur Reviewed-by: Stefano Stabellini Acked-by: Wei Liu Acked-by: Konrad Rzeszutek Wilk --- diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index 7e474bb038..e8033d2579 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -21,6 +21,7 @@ #include "utils.h" #include "io.h" +#include #include #include #include @@ -29,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/xen/include/Makefile b/xen/include/Makefile index 1299b1962f..c90fdeee75 100644 --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -98,6 +98,7 @@ PUBLIC_C99_HEADERS := public/io/9pfs.h public/io/pvcalls.h PUBLIC_ANSI_HEADERS := $(filter-out public/%ctl.h public/xsm/% public/%hvm/save.h $(PUBLIC_C99_HEADERS), $(PUBLIC_HEADERS)) public/io/9pfs.h-prereq := string +public/io/console.h-prereq := string public/io/pvcalls.h-prereq := string headers.chk: $(PUBLIC_ANSI_HEADERS) Makefile diff --git a/xen/include/public/io/console.h b/xen/include/public/io/console.h index e2cd97f77f..0f0711fbdb 100644 --- a/xen/include/public/io/console.h +++ b/xen/include/public/io/console.h @@ -27,6 +27,8 @@ #ifndef __XEN_PUBLIC_IO_CONSOLE_H__ #define __XEN_PUBLIC_IO_CONSOLE_H__ +#include "ring.h" + typedef uint32_t XENCONS_RING_IDX; #define MASK_XENCONS_IDX(idx, ring) ((idx) & (sizeof(ring)-1)) @@ -38,6 +40,10 @@ struct xencons_interface { XENCONS_RING_IDX out_cons, out_prod; }; +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +DEFINE_XEN_FLEX_RING(xencons); +#endif + #endif /* __XEN_PUBLIC_IO_CONSOLE_H__ */ /*